
<template>
  <text><br>{{ formItem.t_name }}</text>
    <uni-easyinput @change="handleInputChange"  v-model="inputValue" placeholder="请输入内容"></uni-easyinput>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
// import { useWebSocket } from "../hook/index";
// const ws = useWebSocket();

const props = defineProps({
  formItem: {
    type: Object,
    required: true
  },
  ws:
  {
  	type:WebSocket,
  	required:true
  }
})

const inputValue = ref(props.formItem.set_value || '')

const handleInputChange = (e: any) => {
	if(e === '') return;
    inputValue.value = e;
    props.ws.send({data: 
    JSON.stringify({
      page: 5,
      type: -1,
      value: inputValue.value,
      config_id: props.formItem.id,
      d_no: 1
    })}
  );
}
</script>